package idv.takeshi.software.productline.bookstore.domain.model.order;

import javax.persistence.Entity;

import org.apache.commons.lang.builder.EqualsBuilder;

/**
 * A kind of Invoice model, which has no invoice title can be set.
 * @author takeshi
 *
 */
@Entity
public class DuplicateInvoiceWithCashier extends Invoice {

	/* (non-Javadoc)
	 * @see idv.takeshi.software.productline.bookstore.domain.model.order.Invoice#getInvoiceTitle()
	 */
	@Override
	public String getInvoiceTitle() {
		//always return null
		return null;
	}

	/* (non-Javadoc)
	 * @see idv.takeshi.software.productline.bookstore.domain.model.order.Invoice#setInvoiceTitle(java.lang.String)
	 */
	@Override
	public void setInvoiceTitle(String invoiceTitle) {
		//DO NOTHING
	}

	/* (non-Javadoc)
	 * @see idv.takeshi.software.productline.bookstore.domain.model.order.Invoice#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj == null) { return false; }
		   if (obj == this) { return true; }
		   if (obj.getClass() != getClass()) {
		     return false;
		   }
		   DuplicateInvoiceWithCashier rhs = (DuplicateInvoiceWithCashier) obj;
		   return new EqualsBuilder()
			   .appendSuper(super.equals(rhs))
		       .isEquals();
	}
	
 
}
 
